<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="format-detection" content="telephone=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><link rel="icon" href="/images/icons/favicon-16x16.png?v=2.8.0" type="image/png" sizes="16x16"><link rel="icon" href="/images/icons/favicon-32x32.png?v=2.8.0" type="image/png" sizes="32x32"><meta name="description" content="III 构建 LFS 交叉工具链和临时工具                             第5节 编译交叉编译工具链">
<meta property="og:type" content="article">
<meta property="og:title" content="LFS-III-构建LFS交叉工具链和临时工具">
<meta property="og:url" content="http://hipposox.github.io/2023/01/12/LFS-III-%E6%9E%84%E5%BB%BALFS%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="III 构建 LFS 交叉工具链和临时工具                             第5节 编译交叉编译工具链">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-01-12T14:52:18.000Z">
<meta property="article:modified_time" content="2023-01-12T15:25:33.402Z">
<meta property="article:author" content="HippoSoX">
<meta property="article:tag" content="LFS">
<meta name="twitter:card" content="summary"><title>LFS-III-构建LFS交叉工具链和临时工具 | Hexo</title><link ref="canonical" href="http://hipposox.github.io/2023/01/12/LFS-III-%E6%9E%84%E5%BB%BALFS%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7/"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/css/all.min.css" type="text/css"><link rel="stylesheet" href="/css/index.css?v=2.8.0"><link rel="stylesheet" href="css/custom.css"><script>var Stun = window.Stun || {};
var CONFIG = {
  root: '/',
  algolia: undefined,
  assistSearch: undefined,
  fontIcon: {"prompt":{"success":"fas fa-check-circle","info":"fas fa-arrow-circle-right","warning":"fas fa-exclamation-circle","error":"fas fa-times-circle"},"copyBtn":"fas fa-copy"},
  sidebar: {"offsetTop":"20px","tocMaxDepth":6},
  header: {"enable":true,"showOnPost":true,"scrollDownIcon":false},
  postWidget: {"endText":true},
  nightMode: {"enable":true},
  back2top: {"enable":true},
  codeblock: {"style":"default","highlight":"dark","wordWrap":false},
  reward: false,
  fancybox: false,
  zoomImage: {"gapAside":"20px"},
  galleryWaterfall: undefined,
  lazyload: true,
  pjax: undefined,
  externalLink: {"icon":{"enable":true,"name":"fas fa-external-link-alt"}},
  shortcuts: undefined,
  prompt: {"copyButton":"复制","copySuccess":"复制成功","copyError":"复制失败"},
  sourcePath: {"js":"js","css":"css","images":"images"},
};

window.CONFIG = CONFIG;</script><meta name="generator" content="Hexo 5.4.2"></head><body><div class="container" id="container"><header class="header" id="header"><div class="header-inner"><nav class="header-nav header-nav--fixed"><div class="header-nav-inner"><div class="header-nav-menubtn"><i class="fas fa-bars"></i></div><div class="header-nav-menu"><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/"><span class="header-nav-menu-item__icon"><i class="fas fa-home"></i></span><span class="header-nav-menu-item__text">首页</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/archives/"><span class="header-nav-menu-item__icon"><i class="fas fa-folder-open"></i></span><span class="header-nav-menu-item__text">归档</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/categories/"><span class="header-nav-menu-item__icon"><i class="fas fa-layer-group"></i></span><span class="header-nav-menu-item__text">分类</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/tags/"><span class="header-nav-menu-item__icon"><i class="fas fa-tags"></i></span><span class="header-nav-menu-item__text">标签</span></a></div></div><div class="header-nav-mode"><div class="mode"><div class="mode-track"><span class="mode-track-moon"></span><span class="mode-track-sun"></span></div><div class="mode-thumb"></div></div></div></div></nav><div class="header-banner"><div class="header-banner-info"><div class="header-banner-info__title">erocool</div><div class="header-banner-info__subtitle">You know what</div></div></div></div></header><main class="main" id="main"><div class="main-inner"><div class="content-wrap" id="content-wrap"><div class="content" id="content"><!-- Just used to judge whether it is an article page--><div id="is-post"></div><div class="post"><header class="post-header"><h1 class="post-title">LFS-III-构建LFS交叉工具链和临时工具</h1><div class="post-meta"><span class="post-meta-item post-meta-item--createtime"><span class="post-meta-item__icon"><i class="far fa-calendar-plus"></i></span><span class="post-meta-item__info">发表于</span><span class="post-meta-item__value">2023-01-12</span></span><span class="post-meta-item post-meta-item--updatetime"><span class="post-meta-item__icon"><i class="far fa-calendar-check"></i></span><span class="post-meta-item__info">更新于</span><span class="post-meta-item__value">2023-01-12</span></span></div></header><div class="post-body">
        <h1 id="iii-构建-lfs-交叉工具链和临时工具"   >
          <a href="#iii-构建-lfs-交叉工具链和临时工具" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#iii-构建-lfs-交叉工具链和临时工具"></a> III 构建 LFS 交叉工具链和临时工具</h1>
      

        <h2 id="第5节-编译交叉编译工具链"   >
          <a href="#第5节-编译交叉编译工具链" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第5节-编译交叉编译工具链"></a> 第5节 编译交叉编译工具链</h2>
      
<span id="more"></span>

        <h3 id="binutils-237-pass-1"   >
          <a href="#binutils-237-pass-1" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#binutils-237-pass-1"></a> Binutils-2.37 - Pass 1</h3>
      
<p>Binutils-2.37，包含汇编器、链接器以及其他用于处理目标文件的工具。</p>
<p>这个包很重要，因为GCC和Glibc的configure运行都会对汇编器和链接器执行各种功能测试，以确定启用或禁用哪些软件功能。</p>
<p>1SBU=2min1.239s</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ./binutils-2.37.tar.xz </span><br><span class="line">cd binutils-2.37</span><br><span class="line">mkdir -v build</span><br><span class="line">cd build/</span><br><span class="line">time &#123; ../configure --prefix=$LFS/tools \</span><br><span class="line">--with-sysroot=$LFS \</span><br><span class="line">--target=$LFS_TGT \</span><br><span class="line">--disable-nls \</span><br><span class="line">--disable-werror &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line">cd ../..</span><br><span class="line">rm -rf binutils-2.37 </span><br></pre></td></tr></table></div></figure>
<blockquote>
<p>警告：<br />
checking for -plugin option… ar: no operation specified<br />
configure: WARNING: Failed: ar --plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so rc<br />
no<br />
选择无视这个警告</p>
</blockquote>
<p>结论：1SBU=2min</p>

        <h3 id="gcc-1120-pass-1"   >
          <a href="#gcc-1120-pass-1" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#gcc-1120-pass-1"></a> GCC-11.2.0 - Pass 1</h3>
      
<p>12SBU=19m26.439s</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ./gcc-11.2.0.tar.xz </span><br><span class="line">cd gcc-11.2.0</span><br><span class="line">tar -xf ../mpfr-4.1.0.tar.xz</span><br><span class="line">tar -xf ../gmp-6.2.1.tar.xz</span><br><span class="line">tar -xf ../mpc-1.2.1.tar.gz</span><br><span class="line">mv -v mpfr-4.1.0 mpfr</span><br><span class="line">mv -v gmp-6.2.1 gmp</span><br><span class="line">mv -v mpc-1.2.1 mpc</span><br><span class="line"></span><br><span class="line">case $(uname -m) in</span><br><span class="line">x86_64)</span><br><span class="line">sed -e &#x27;/m64=/s/lib64/lib/&#x27; \</span><br><span class="line">-i.orig gcc/config/i386/t-linux64</span><br><span class="line">;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">mkdir -v build</span><br><span class="line">cd build</span><br><span class="line"></span><br><span class="line">time &#123; ../configure \</span><br><span class="line"> --target=$LFS_TGT \</span><br><span class="line"> --prefix=$LFS/tools \</span><br><span class="line"> --with-glibc-version=2.11 \</span><br><span class="line"> --with-sysroot=$LFS \</span><br><span class="line"> --with-newlib \</span><br><span class="line"> --without-headers \</span><br><span class="line"> --enable-initfini-array \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --disable-shared \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-decimal-float \</span><br><span class="line"> --disable-threads \</span><br><span class="line"> --disable-libatomic \</span><br><span class="line"> --disable-libgomp \</span><br><span class="line"> --disable-libquadmath \</span><br><span class="line"> --disable-libssp \</span><br><span class="line"> --disable-libvtv \</span><br><span class="line"> --disable-libstdcxx \</span><br><span class="line"> --enable-languages=c,c++ &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">cat gcc/limitx.h gcc/glimits.h gcc/limity.h &gt; `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf gcc-11.2.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<blockquote>
<p>报错：<br />
checking for suffix of object files… configure: error: in <code>/mnt/lfs/sources/gcc-11.2.0/build/x86_64-lfs-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile See </code>config.log’ for more details<br />
Makefile:13649: recipe for target ‘configure-target-libgcc’ failed<br />
make[1]: *** [configure-target-libgcc] Error 1<br />
make[1]: Leaving directory ‘/mnt/lfs/sources/gcc-11.2.0/build’<br />
Makefile:946: recipe for target ‘all’ failed<br />
make: *** [all] Error 2</p>
</blockquote>
<blockquote>
<p>检查…/configure输出，发现报错<br />
required isl version is 0.15 or later<br />
*** This configuration is not supported in the following subdirectories:<br />
target-libquadmath target-libstdc+±v3 gnattools gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libobjc target-libgomp target-liboffloadmic target-libatomic target-libvtv target-libssp target-libitm target-libsanitizer<br />
(Any other directories should still work fine.)<br />
checking for default BUILD_CONFIG…</p>
</blockquote>
<blockquote>
<p>处理过程中发现虚拟机断网，故重启</p>
</blockquote>
<blockquote>
<p>获取isl</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.12.2.tar.bz2</span><br><span class="line">tar jxvf isl-0.12.2.tar.bz2</span><br><span class="line">cd isl-0.12.2</span><br><span class="line">mkdir build</span><br><span class="line">cd build</span><br><span class="line">../configure</span><br><span class="line">make</span><br><span class="line">sudo make install -j4</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
</blockquote>
<blockquote>
<p>配置isl过程中发现报错<br />
checking gmp.h usability… no<br />
checking gmp.h presence… no<br />
checking for gmp.h… no<br />
configure: error: gmp.h header not found</p>
</blockquote>
<blockquote>
<p>安装gmp包<br />
<code>wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz</code><br />
发现.lz无法解压，换.xz包</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz</span><br><span class="line">tar -xvf gmp-6.2.1.tar.xz</span><br><span class="line">cd gmp-6.2.1</span><br><span class="line">mkdir build</span><br><span class="line">cd build</span><br><span class="line">../configure</span><br><span class="line">make</span><br><span class="line">sudo make install -j4</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
</blockquote>
<blockquote>
<p>重启后发现/mnt/lfs下文件全部不见，重新来T_T<br />
重复下载软件包和最后的准备工作<br />
重新下载使用lfs执行wget，所有资源包所有者都是lfs</p>
</blockquote>
<blockquote>
<p>在glibc的检测步骤中发现不成功，因此回过头来将isl升级到0.18</p>
</blockquote>
<blockquote>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2</span><br><span class="line">tar -jxvf isl-0.18.tar.bz2</span><br><span class="line">cd isl-0.18/</span><br><span class="line">mkdir temp</span><br><span class="line">cd temp</span><br><span class="line">sudo ../configure --prefix=/usr/local/isl-0.18</span><br><span class="line">sudo make</span><br><span class="line">sudo make install</span><br></pre></td></tr></table></div></figure>
</blockquote>
<blockquote>
<p>然后configure增加一个参数<br />
<code>--with-isl=/usr/local/isl-0.18</code></p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">../configure \</span><br><span class="line"> --target=$LFS_TGT \</span><br><span class="line"> --prefix=$LFS/tools \</span><br><span class="line"> --with-glibc-version=2.11 \</span><br><span class="line"> --with-isl=/usr/local/isl-0.18 \</span><br><span class="line"> --with-sysroot=$LFS \</span><br><span class="line"> --with-newlib \</span><br><span class="line"> --without-headers \</span><br><span class="line"> --enable-initfini-array \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --disable-shared \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-decimal-float \</span><br><span class="line"> --disable-threads \</span><br><span class="line"> --disable-libatomic \</span><br><span class="line"> --disable-libgomp \</span><br><span class="line"> --disable-libquadmath \</span><br><span class="line"> --disable-libssp \</span><br><span class="line"> --disable-libvtv \</span><br><span class="line"> --disable-libstdcxx \</span><br><span class="line"> --enable-languages=c,c++</span><br></pre></td></tr></table></div></figure>
<p>不行，报错，放弃这个参数</p>
</blockquote>

        <h3 id="linux-51312-api-headers"   >
          <a href="#linux-51312-api-headers" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#linux-51312-api-headers"></a> Linux-5.13.12 API Headers</h3>
      
<p>0.1SBU</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf linux-5.13.12.tar.xz</span><br><span class="line">cd linux-5.13.12</span><br><span class="line">make mrproper</span><br><span class="line">make headers</span><br><span class="line">find usr/include -name &#x27;.*&#x27; -delete</span><br><span class="line">rm usr/include/Makefile</span><br><span class="line">cp -rv usr/include $LFS/usr</span><br><span class="line">cd ..</span><br><span class="line">rm -rf linux-5.13.12</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="glibc-234"   >
          <a href="#glibc-234" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#glibc-234"></a> glibc-2.34</h3>
      
<p>4.2SBU=16.8min</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf glibc-2.34.tar.xz</span><br><span class="line">cd glibc-2.34</span><br><span class="line"></span><br><span class="line">case $(uname -m) in</span><br><span class="line"> i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3</span><br><span class="line"> ;;</span><br><span class="line"> x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64</span><br><span class="line"> ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3</span><br><span class="line"> ;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">patch -Np1 -i ../glibc-2.34-fhs-1.patch</span><br><span class="line"></span><br><span class="line">mkdir -v build</span><br><span class="line">cd build</span><br><span class="line"></span><br><span class="line">echo &quot;rootsbindir=/usr/sbin&quot; &gt; configparms</span><br><span class="line"></span><br><span class="line">time &#123; ../configure \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(../scripts/config.guess) \</span><br><span class="line"> --enable-kernel=3.2 \</span><br><span class="line"> --with-headers=$LFS/usr/include \</span><br><span class="line"> libc_cv_slibdir=/usr/lib &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">sed &#x27;/RTLDLIST=/s@/usr@@g&#x27; -i $LFS/usr/bin/ldd</span><br><span class="line"></span><br><span class="line">//在这里检查</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">$</span><span class="language-bash">LFS/tools/libexec/gcc/<span class="variable">$LFS_TGT</span>/11.2.0/install-tools/mkheaders</span></span><br><span class="line"></span><br><span class="line">cd ../..</span><br><span class="line">rm -rf glibc-2.34</span><br><span class="line"></span><br><span class="line">报错：</span><br><span class="line">x86_64-lfs-linux-gnu-gcc   -shared -nostdlib -nostartfiles \</span><br><span class="line">	  -x assembler /dev/null -o /mnt/lfs/sources/glibc-2.34/build/format.lds.so</span><br><span class="line">make[1]: x86_64-lfs-linux-gnu-gcc: Command not found</span><br><span class="line">Makerules:1043: recipe for target &#x27;/mnt/lfs/sources/glibc-2.34/build/format.lds&#x27; failed</span><br><span class="line">make[1]: *** [/mnt/lfs/sources/glibc-2.34/build/format.lds] Error 127</span><br><span class="line">make[1]: Leaving directory &#x27;/mnt/lfs/sources/glibc-2.34&#x27;</span><br><span class="line">Makefile:12: recipe for target &#x27;install&#x27; failed</span><br><span class="line">make: *** [install] Error 2</span><br><span class="line">解决：</span><br><span class="line">放弃sudo权限</span><br><span class="line">make DESTDIR=$LFS install -j4</span><br></pre></td></tr></table></div></figure>
<blockquote>
<p>小心<br />
到了这里，必须停下来确认新工具链的基本功能(编译和链接)都是像预期的那样正常工作。运行下面的命令进行全面的检查：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">echo &#x27;int main()&#123;&#125;&#x27; &gt; dummy.c</span><br><span class="line"><span class="meta prompt_">$</span><span class="language-bash">LFS_TGT-gcc dummy.c</span></span><br><span class="line">readelf -l a.out | grep &#x27;/ld-linux&#x27;</span><br><span class="line">rm -v dummy.c a.out</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>如果一切工作正常的话，这里应该没有错误，最后一个命令的输出形式会是：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</span><br></pre></td></tr></table></div></figure>
<p>注意 32 位机器上对应的解释器名字是 /tools/lib/ld-linux.so.2。</p>
<p>如果输出不是像上面那样或者根本就没有输出，那么可能某些地方出错了。调查并回溯这些步骤，找出问题所在并改正它。在继续之前必须解决这个问题。</p>
<p>一旦一切都顺利，清理测试文件：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">rm -v dummy.c a.out</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
</blockquote>

        <h3 id="libstdc-from-gcc-1120-pass-1"   >
          <a href="#libstdc-from-gcc-1120-pass-1" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#libstdc-from-gcc-1120-pass-1"></a> Libstdc++ from GCC-11.2.0 - Pass 1</h3>
      
<p>0.4SBU=0.8min</p>
<p>c++源码在gcc里面，因此要重新解压gcc包</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ./gcc-11.2.0.tar.xz </span><br><span class="line">cd gcc-11.2.0</span><br><span class="line"></span><br><span class="line">mkdir -v build</span><br><span class="line">cd build</span><br><span class="line"></span><br><span class="line">time &#123; ../libstdc++-v3/configure \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(../config.guess) \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --disable-libstdcxx-pch \</span><br><span class="line"> --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/11.2.0 &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ../..</span><br><span class="line">rm -rf gcc-11.2.0</span><br><span class="line"></span><br><span class="line"> 报错，无法安装</span><br><span class="line"> libtool: install: x86_64-lfs-linux-gnu-ranlib /mnt/lfs/usr/lib/../lib/libsupc++.a</span><br><span class="line">../libtool: line 1132: x86_64-lfs-linux-gnu-ranlib: command not found</span><br><span class="line">Makefile:707: recipe for target &#x27;install-toolexeclibLTLIBRARIES&#x27; failed</span><br><span class="line">make[2]: *** [install-toolexeclibLTLIBRARIES] Error 127</span><br><span class="line">make[2]: Leaving directory &#x27;/mnt/lfs/sources/gcc-11.2.0/build/libsupc++&#x27;</span><br><span class="line">Makefile:841: recipe for target &#x27;install-am&#x27; failed</span><br><span class="line">make[1]: *** [install-am] Error 2</span><br><span class="line">make[1]: Leaving directory &#x27;/mnt/lfs/sources/gcc-11.2.0/build/libsupc++&#x27;</span><br><span class="line">Makefile:568: recipe for target &#x27;install-recursive&#x27; failed</span><br><span class="line">make: *** [install-recursive] Error 1</span><br><span class="line"></span><br><span class="line">检查配置../libstdc++-v3/configure，发现警告</span><br><span class="line">configure: WARNING: === You have requested GNU symbol versioning, but</span><br><span class="line">configure: WARNING: === you are not building a shared libgcc_s.</span><br><span class="line">configure: WARNING: === Symbol versioning will be disabled.</span><br><span class="line">报错</span><br><span class="line">Makefile:1765: recipe for target &#x27;x86_64-lfs-linux-gnu/bits/largefile-config.h&#x27; failed</span><br><span class="line">make: [x86_64-lfs-linux-gnu/bits/largefile-config.h] Error 1 (ignored)</span><br><span class="line">Makefile:1765: recipe for target &#x27;x86_64-lfs-linux-gnu/bits/largefile-config.h&#x27; failed</span><br><span class="line">make: [x86_64-lfs-linux-gnu/bits/largefile-config.h] Error 1 (ignored)</span><br><span class="line"></span><br><span class="line">检查configure</span><br><span class="line">configure: target-libgomp not built</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>做到这里时，发现重启后没有mount /dev/sda3，没有挂载硬盘，导致卷土重来。</p>
<p>做到检查那一步时，失败，同样卷土重来。</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/11.2.0/../../../../x86_64-lfs-linux-gnu/bin/ld: cannot find -lgcc_s</span><br><span class="line">collect2: error: ld returned 1 exit status</span><br><span class="line">../Rules:222: recipe for target &#x27;/mnt/lfs/sources/glibc-2.34/build/support/links-dso-program&#x27; failed</span><br><span class="line">make[2]: *** [/mnt/lfs/sources/glibc-2.34/build/support/links-dso-program] Error 1</span><br><span class="line">make[2]: Leaving directory &#x27;/mnt/lfs/sources/glibc-2.34/support&#x27;</span><br><span class="line">Makefile:478: recipe for target &#x27;support/others&#x27; failed</span><br><span class="line">make[1]: *** [support/others] Error 2</span><br><span class="line">make[1]: Leaving directory &#x27;/mnt/lfs/sources/glibc-2.34&#x27;</span><br><span class="line">Makefile:9: recipe for target &#x27;all&#x27; failed</span><br><span class="line">make: *** [all] Error 2</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="重启后回复工作状态-1"   >
          <a href="#重启后回复工作状态-1" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#重启后回复工作状态-1"></a> 重启后回复工作状态 #1</h3>
      
<p>从现在开始一直到临时系统制作结束，也就是完成<strong>Stripping</strong>中间的步骤中如果重新启动的恢复步骤：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">su</span><br><span class="line">mount /dev/sda* $LFS</span><br></pre></td></tr></table></div></figure>

        <h2 id="第6章-交叉编译临时工具"   >
          <a href="#第6章-交叉编译临时工具" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第6章-交叉编译临时工具"></a> 第6章 交叉编译临时工具</h2>
      

        <h3 id="m4-1419"   >
          <a href="#m4-1419" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#m4-1419"></a> m4-1.4.19</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf m4-1.4.19.tar.xz</span><br><span class="line">cd m4-1.4.19</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf m4-1.4.19</span><br></pre></td></tr></table></div></figure>

        <h3 id="出错解决"   >
          <a href="#出错解决" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#出错解决"></a> 出错解决</h3>
      

        <h4 id="m4coreutilsgzipsedtar"   >
          <a href="#m4coreutilsgzipsedtar" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#m4coreutilsgzipsedtar"></a> m4&amp;coreutils&amp;Gzip&amp;sed&amp;tar:</h4>
      
<blockquote>
<p>In file included from /mnt/lfs/usr/include/stdlib.h:1024,<br />
from ./stdlib.h:36,<br />
from chdir-long.c:25:<br />
/mnt/lfs/usr/include/bits/stdlib.h: In function ‘wctomb’:<br />
/mnt/lfs/usr/include/bits/stdlib.h:94:3: error: #error “Assumed value of MB_LEN_MAX wrong”<br />
94 | # error “Assumed value of MB_LEN_MAX wrong”<br />
|   ^~~~~<br />
Makefile:1866: recipe for target ‘chdir-long.o’ failed<br />
make[3]: *** [chdir-long.o] Error 1<br />
make[3]: Leaving directory ‘/mnt/lfs/sources/gzip-1.10/lib’<br />
Makefile:1667: recipe for target ‘all’ failed<br />
make[2]: *** [all] Error 2<br />
make[2]: Leaving directory ‘/mnt/lfs/sources/gzip-1.10/lib’<br />
Makefile:1768: recipe for target ‘all-recursive’ failed<br />
make[1]: *** [all-recursive] Error 1<br />
make[1]: Leaving directory ‘/mnt/lfs/sources/gzip-1.10’<br />
Makefile:1549: recipe for target ‘all’ failed<br />
make: *** [all] Error 2</p>
</blockquote>
<p>解决：在gcc解压包中的gcc文件夹中找到glimits.h，将MB_MAX_LENGTH由1改为16</p>

        <h4 id="diffutilsgreppatch"   >
          <a href="#diffutilsgreppatch" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#diffutilsgreppatch"></a> diffutils&amp;grep&amp;patch:</h4>
      
<blockquote>
<p>stackvma.c: In function ‘rof_open’:<br />
stackvma.c:122:30: error: ‘PATH_MAX’ undeclared (first use in this function)<br />
122 | #  define MIN_LEFTOVER (73 + PATH_MAX)<br />
|                              ^~~~~~~~<br />
stackvma.c:172:18: note: in expansion of macro ‘MIN_LEFTOVER’<br />
172 |       if (size &gt; MIN_LEFTOVER)<br />
|                  ^~~~~~~~~~~~<br />
stackvma.c:122:30: note: each undeclared identifier is reported only once for each function it appears in<br />
122 | #  define MIN_LEFTOVER (73 + PATH_MAX)<br />
|                              ^~~~~~~~<br />
stackvma.c:172:18: note: in expansion of macro ‘MIN_LEFTOVER’<br />
172 |       if (size &gt; MIN_LEFTOVER)<br />
|                  ^~~~~~~~~~~~<br />
Makefile:2319: recipe for target ‘stackvma.o’ failed<br />
make[2]: *** [stackvma.o] Error 1<br />
make[2]: Leaving directory ‘/mnt/lfs/sources/diffutils-3.8/lib’<br />
Makefile:2019: recipe for target ‘all’ failed<br />
make[1]: *** [all] Error 2<br />
make[1]: Leaving directory ‘/mnt/lfs/sources/diffutils-3.8/lib’<br />
Makefile:1650: recipe for target ‘all-recursive’ failed<br />
make: *** [all-recursive] Error 1</p>
</blockquote>
<p>解决：在出错的源文件中加入<code>#include &lt;linux/limits.h&gt;</code></p>

        <h4 id="findutils"   >
          <a href="#findutils" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#findutils"></a> findutils:</h4>
      
<blockquote>
<p>buildcmd.c: In function ‘bc_init_controlinfo’:<br />
buildcmd.c:491:29: error: ‘_POSIX_ARG_MAX’ undeclared (first use in this function); did you mean ‘_SC_ARG_MAX’?<br />
491 |   ctl-&gt;posix_arg_size_min = _POSIX_ARG_MAX;<br />
|                             ^~~~~~~~~~~~~~<br />
|                             _SC_ARG_MAX<br />
buildcmd.c:491:29: note: each undeclared identifier is reported only once for each function it appears in<br />
Makefile:2296: recipe for target ‘buildcmd.o’ failed<br />
make[2]: *** [buildcmd.o] Error 1<br />
make[2]: Leaving directory ‘/mnt/lfs/sources/findutils-4.8.0/lib’<br />
Makefile:2357: recipe for target ‘all-recursive’ failed<br />
make[1]: *** [all-recursive] Error 1<br />
make[1]: Leaving directory ‘/mnt/lfs/sources/findutils-4.8.0’<br />
Makefile:2296: recipe for target ‘all’ failed<br />
make: *** [all] Error 2</p>
</blockquote>
<p>解决：在出错的源文件中加入<code>#include &lt;bits/posix1_lim.h&gt;</code></p>

        <h3 id="ncurses-62"   >
          <a href="#ncurses-62" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#ncurses-62"></a> Ncurses-6.2</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ncurses-6.2.tar.gz</span><br><span class="line">cd ncurses-6.2</span><br><span class="line"></span><br><span class="line">sed -i s/mawk// configure</span><br><span class="line"></span><br><span class="line">mkdir build</span><br><span class="line">pushd build</span><br><span class="line"> ../configure</span><br><span class="line"> make -C include</span><br><span class="line"> make -C progs tic</span><br><span class="line">popd</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(./config.guess) \</span><br><span class="line"> --mandir=/usr/share/man \</span><br><span class="line"> --with-manpage-format=normal \</span><br><span class="line"> --with-shared \</span><br><span class="line"> --without-debug \</span><br><span class="line"> --without-ada \</span><br><span class="line"> --without-normal \</span><br><span class="line"> --enable-widec &amp;&amp; make &amp;&amp; make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install;&#125;</span><br><span class="line"></span><br><span class="line">echo &quot;INPUT(-lncursesw)&quot; &gt; $LFS/usr/lib/libncurses.so</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf ncurses-6.2</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="bash-518"   >
          <a href="#bash-518" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#bash-518"></a> Bash-5.1.8</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf bash-5.1.8.tar.gz</span><br><span class="line">cd bash-5.1.8</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --build=$(support/config.guess) \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --without-bash-malloc &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"> </span><br><span class="line">ln -sv bash $LFS/bin/sh</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf bash-5.1.8</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="coreutils-832"   >
          <a href="#coreutils-832" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#coreutils-832"></a> coreutils-8.32</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf coreutils-8.32.tar.xz</span><br><span class="line">cd coreutils-8.32</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) \</span><br><span class="line"> --enable-install-program=hostname \</span><br><span class="line"> --enable-no-install-program=kill,uptime &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">mv -v $LFS/usr/bin/chroot $LFS/usr/sbin</span><br><span class="line">mkdir -pv $LFS/usr/share/man/man8</span><br><span class="line">mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8</span><br><span class="line">sed -i &#x27;s/&quot;1&quot;/&quot;8&quot;/&#x27; $LFS/usr/share/man/man8/chroot.8</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf coreutils-8.32</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="diffutils-38"   >
          <a href="#diffutils-38" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#diffutils-38"></a> diffutils-3.8</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf diffutils-3.8.tar.xz</span><br><span class="line">cd diffutils-3.8</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr --host=$LFS_TGT &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf diffutils-3.8</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="file-540"   >
          <a href="#file-540" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#file-540"></a> File-5.40</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf file-5.40.tar.gz </span><br><span class="line"></span><br><span class="line">cd file-5.40</span><br><span class="line"></span><br><span class="line">mkdir build</span><br><span class="line">pushd build</span><br><span class="line"> ../configure --disable-bzlib \</span><br><span class="line"> --disable-libseccomp \</span><br><span class="line"> --disable-xzlib \</span><br><span class="line"> --disable-zlib</span><br><span class="line"> make</span><br><span class="line">popd</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess) &amp;&amp; make FILE_COMPILE=$(pwd)/build/src/file &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf file-5.40</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="findutils-480"   >
          <a href="#findutils-480" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#findutils-480"></a> Findutils-4.8.0</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf findutils-4.8.0.tar.xz</span><br><span class="line">cd findutils-4.8.0</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --localstatedir=/var/lib/locate \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf findutils-4.8.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="gawk-510"   >
          <a href="#gawk-510" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#gawk-510"></a> gawk-5.1.0</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf gawk-5.1.0.tar.xz</span><br><span class="line">cd gawk-5.1.0</span><br><span class="line"></span><br><span class="line">sed -i &#x27;s/extras//&#x27; Makefile.in</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(./config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf gawk-5.1.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="grep-37"   >
          <a href="#grep-37" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#grep-37"></a> grep-3.7</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf grep-3.7.tar.xz</span><br><span class="line">cd grep-3.7</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf grep-3.7</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="gzip-110"   >
          <a href="#gzip-110" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#gzip-110"></a> gzip-1.10</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf gzip-1.10.tar.xz</span><br><span class="line">cd gzip-1.10</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf gzip-1.10</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="make-43"   >
          <a href="#make-43" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#make-43"></a> Make-4.3</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf make-4.3.tar.gz</span><br><span class="line">cd make-4.3</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --without-guile \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf make-4.3</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="patch-276"   >
          <a href="#patch-276" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#patch-276"></a> Patch-2.7.6</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf patch-2.7.6.tar.xz</span><br><span class="line">cd patch-2.7.6</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf patch-2.7.6</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="sed-48"   >
          <a href="#sed-48" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#sed-48"></a> Sed-4.8</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf sed-4.8.tar.xz</span><br><span class="line">cd sed-4.8</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf sed-4.8</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="tar-134"   >
          <a href="#tar-134" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#tar-134"></a> tar-1.34</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf tar-1.34.tar.xz</span><br><span class="line">cd tar-1.34</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf tar-1.34</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="xz-525"   >
          <a href="#xz-525" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#xz-525"></a> xz-5.2.5</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf xz-5.2.5.tar.xz</span><br><span class="line">cd xz-5.2.5</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --build=$(build-aux/config.guess) \</span><br><span class="line"> --disable-static \</span><br><span class="line"> --docdir=/usr/share/doc/xz-5.2.5 &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf xz-5.2.5</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="binutils-237-pass-2"   >
          <a href="#binutils-237-pass-2" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#binutils-237-pass-2"></a> binutils-2.37 pass 2</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ./binutils-2.37.tar.xz </span><br><span class="line">cd binutils-2.37</span><br><span class="line">mkdir -v build</span><br><span class="line">cd build/</span><br><span class="line"></span><br><span class="line">time &#123; ../configure \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --build=$(../config.guess) \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --enable-shared \</span><br><span class="line"> --disable-werror \</span><br><span class="line"> --enable-64-bit-bfd &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install -j1;&#125;</span><br><span class="line"></span><br><span class="line">install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib</span><br><span class="line"></span><br><span class="line">cd ../..</span><br><span class="line">rm -rf binutils-2.37</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="gcc-1120-pass-2"   >
          <a href="#gcc-1120-pass-2" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#gcc-1120-pass-2"></a> GCC-11.2.0 pass 2</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf ./gcc-11.2.0.tar.xz </span><br><span class="line">cd gcc-11.2.0</span><br><span class="line">tar -xf ../mpfr-4.1.0.tar.xz</span><br><span class="line">tar -xf ../gmp-6.2.1.tar.xz</span><br><span class="line">tar -xf ../mpc-1.2.1.tar.gz</span><br><span class="line">mv -v mpfr-4.1.0 mpfr</span><br><span class="line">mv -v gmp-6.2.1 gmp</span><br><span class="line">mv -v mpc-1.2.1 mpc</span><br><span class="line"></span><br><span class="line">case $(uname -m) in</span><br><span class="line"> x86_64)</span><br><span class="line"> sed -e &#x27;/m64=/s/lib64/lib/&#x27; -i.orig gcc/config/i386/t-linux64</span><br><span class="line"> ;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">mkdir -v build</span><br><span class="line">cd build/</span><br><span class="line"></span><br><span class="line">mkdir -pv $LFS_TGT/libgcc</span><br><span class="line">ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</span><br><span class="line"></span><br><span class="line">time &#123; ../configure \</span><br><span class="line"> --build=$(../config.guess) \</span><br><span class="line"> --host=$LFS_TGT \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> CC_FOR_TARGET=$LFS_TGT-gcc \</span><br><span class="line"> --with-build-sysroot=$LFS \</span><br><span class="line"> --enable-initfini-array \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-decimal-float \</span><br><span class="line"> --disable-libatomic \</span><br><span class="line"> --disable-libgomp \</span><br><span class="line"> --disable-libquadmath \</span><br><span class="line"> --disable-libssp \</span><br><span class="line"> --disable-libvtv \</span><br><span class="line"> --disable-libstdcxx \</span><br><span class="line"> --enable-languages=c,c++ &amp;&amp; make &amp;&amp; make DESTDIR=$LFS install;&#125;</span><br><span class="line"></span><br><span class="line">ln -sv gcc $LFS/usr/bin/cc</span><br><span class="line"></span><br><span class="line">cd ../..</span><br><span class="line">rm -rf gcc-11.2.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p><strong>！！！在这里备份！！！</strong></p>

        <h2 id="第7章-改变文件属主并构建其他临时工具"   >
          <a href="#第7章-改变文件属主并构建其他临时工具" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第7章-改变文件属主并构建其他临时工具"></a> 第7章 改变文件属主并构建其他临时工具</h2>
      

        <h3 id="chroot"   >
          <a href="#chroot" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#chroot"></a> chroot</h3>
      
<p>进入root</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">su</span><br></pre></td></tr></table></div></figure>
<p>准备虚拟内核</p>
<p>概述<br />
首先，安装一些软件包的构建机制所必须的工具。这样就解决了所有的循环依赖问题，可以使用 chroot 环境进行构建，它与宿主系统除正在运行的内核外完全隔离。</p>
<p>为了隔离环境的正常工作，必须它与正在运行的内核之间建立一些通信机制。通过所谓的虚拟内核文件系统达成这一目的，它们必须在进入 chroot 环境时挂载。</p>
<p>从现在开始，所有命令必须以 root 用户身份执行，且 LFS 变量必须正确设定。 在进入 chroot 之后，仍然以 root 身份执行所有命令！</p>
<p>改变所有者</p>
<p>目前，$LFS 中整个目录树的所有者都是 lfs，这个用户只在宿主系统存在。</p>
<p>如果不改变 $LFS 中文件和目录的所有权，它们会被一个没有对应账户的用户 ID 所有。这是危险的，因为后续创建的新用户可能获得这个用户 ID，并成为 $LFS 中全部文件的所有者，从而产生恶意操作这些文件的可能。</p>
<p>为了避免这样的问题，执行以下命令，将 $LFS/* 目录的所有者改变为 root：</p>
<p>准备虚拟内核文件系统</p>
<p>内核对外提供了一些文件系统，以便自己和用户空间进行通信。它们是虚拟文件系统，并不占用磁盘空间，其内容保留在内存中。</p>
<p>首先创建这些文件系统的挂载点：</p>
<p>创建初始设备节点</p>
<p>在内核引导系统时，它需要一些设备节点，特别是 console 和 null 两个设备。它们需要创建在硬盘上，这样在内核填充 /dev 前，或者 Linux 使用 init=/bin/bash 内核选项启动时，也能使用它们。</p>
<p>运行以下命令创建它们：</p>
<p>挂载和填充 /dev<br />
用设备文件填充 /dev 目录的推荐方法是挂载一个虚拟文件系统 (例如 tmpfs) 到 /dev，然后在设备被发现或访问时动态地创建设备文件。</p>
<p>这个工作通常由 Udev 在系统引导时完成。然而，我们的新系统还没有 Udev，也没有被引导过，因此必须手工挂载和填充 /dev。这可以通过绑定挂载宿主系统的 /dev 目录就实现。绑定挂载是一种特殊挂载类型，它允许在另外的位置创建某个目录或挂载点的映像。</p>
<p>运行以下命令进行绑定挂载：</p>
<p>挂载虚拟内核文件系统</p>
<p>现在挂载其余的虚拟内核文件系统：</p>
<p>在某些宿主系统上，/dev/shm 是一个指向 /run/shm 的符号链接。我们已经在 /run 下挂载了 tmpfs 文件系统，因此在这里只需要创建一个目录。</p>
<p>chroot</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br></pre></td><td class="code"><pre><span class="line">chown -R root:root $LFS/&#123;usr,lib,var,etc,bin,sbin,tools&#125;</span><br><span class="line">case $(uname -m) in</span><br><span class="line"> x86_64) chown -R root:root $LFS/lib64 ;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">mkdir -pv $LFS/&#123;dev,proc,sys,run&#125;</span><br><span class="line"></span><br><span class="line">mknod -m 600 $LFS/dev/console c 5 1</span><br><span class="line">mknod -m 666 $LFS/dev/null c 1 3</span><br><span class="line"></span><br><span class="line">mount -v --bind /dev $LFS/dev</span><br><span class="line"></span><br><span class="line">mount -v --bind /dev/pts $LFS/dev/pts</span><br><span class="line">mount -vt proc proc $LFS/proc</span><br><span class="line">mount -vt sysfs sysfs $LFS/sys</span><br><span class="line">mount -vt tmpfs tmpfs $LFS/run</span><br><span class="line"></span><br><span class="line">if [ -h $LFS/dev/shm ]; then</span><br><span class="line"> mkdir -pv $LFS/$(readlink $LFS/dev/shm)</span><br><span class="line">fi</span><br><span class="line"></span><br><span class="line">chroot &quot;$LFS&quot; /usr/bin/env -i \</span><br><span class="line"> HOME=/root \</span><br><span class="line"> TERM=&quot;$TERM&quot; \</span><br><span class="line"> PS1=&#x27;(lfs chroot) \u:\w\$ &#x27; \</span><br><span class="line"> PATH=/usr/bin:/usr/sbin \</span><br><span class="line"> /bin/bash --login +h </span><br><span class="line"></span><br><span class="line">mkdir -pv /&#123;boot,home,mnt,opt,srv&#125;</span><br><span class="line"></span><br><span class="line">mkdir -pv /etc/&#123;opt,sysconfig&#125;</span><br><span class="line">mkdir -pv /lib/firmware</span><br><span class="line">mkdir -pv /media/&#123;floppy,cdrom&#125;</span><br><span class="line">mkdir -pv /usr/&#123;,local/&#125;&#123;include,src&#125;</span><br><span class="line">mkdir -pv /usr/local/&#123;bin,lib,sbin&#125;</span><br><span class="line">mkdir -pv /usr/&#123;,local/&#125;share/&#123;color,dict,doc,info,locale,man&#125;</span><br><span class="line">mkdir -pv /usr/&#123;,local/&#125;share/&#123;misc,terminfo,zoneinfo&#125;</span><br><span class="line">mkdir -pv /usr/&#123;,local/&#125;share/man/man&#123;1..8&#125;</span><br><span class="line">mkdir -pv /var/&#123;cache,local,log,mail,opt,spool&#125;</span><br><span class="line">mkdir -pv /var/lib/&#123;color,misc,locate&#125;</span><br><span class="line">ln -sfv /run /var/run</span><br><span class="line">ln -sfv /run/lock /var/lock</span><br><span class="line">install -dv -m 0750 /root</span><br><span class="line">install -dv -m 1777 /tmp /var/tmp</span><br><span class="line"></span><br><span class="line">ln -sv /proc/self/mounts /etc/mtab</span><br><span class="line"></span><br><span class="line">cat &gt; /etc/hosts &lt;&lt; EOF</span><br><span class="line">127.0.0.1 localhost $(hostname)</span><br><span class="line">::1 localhost</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line">cat &gt; /etc/passwd &lt;&lt; &quot;EOF&quot;</span><br><span class="line">root:x:0:0:root:/root:/bin/bash</span><br><span class="line">bin:x:1:1:bin:/dev/null:/bin/false</span><br><span class="line">daemon:x:6:6:Daemon User:/dev/null:/bin/false</span><br><span class="line">messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/bin/false</span><br><span class="line">uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/bin/false</span><br><span class="line">nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line">cat &gt; /etc/group &lt;&lt; &quot;EOF&quot;</span><br><span class="line">root:x:0:</span><br><span class="line">bin:x:1:daemon</span><br><span class="line">sys:x:2:</span><br><span class="line">kmem:x:3:</span><br><span class="line">tape:x:4:</span><br><span class="line">tty:x:5:</span><br><span class="line">daemon:x:6:</span><br><span class="line">floppy:x:7:</span><br><span class="line">disk:x:8:</span><br><span class="line">lp:x:9:</span><br><span class="line">dialout:x:10:</span><br><span class="line">audio:x:11:</span><br><span class="line">video:x:12:</span><br><span class="line">utmp:x:13:</span><br><span class="line">usb:x:14:</span><br><span class="line">cdrom:x:15:</span><br><span class="line">adm:x:16:</span><br><span class="line">messagebus:x:18:</span><br><span class="line">input:x:24:</span><br><span class="line">mail:x:34:</span><br><span class="line">kvm:x:61:</span><br><span class="line">uuidd:x:80:</span><br><span class="line">wheel:x:97:</span><br><span class="line">nogroup:x:99:</span><br><span class="line">users:x:999:</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line">echo &quot;tester:x:101:101::/home/tester:/bin/bash&quot; &gt;&gt; /etc/passwd</span><br><span class="line">echo &quot;tester:x:101:&quot; &gt;&gt; /etc/group</span><br><span class="line">install -o tester -d /home/tester</span><br><span class="line"></span><br><span class="line">exec /bin/bash --login +h</span><br><span class="line"></span><br><span class="line">touch /var/log/&#123;btmp,lastlog,faillog,wtmp&#125;</span><br><span class="line">chgrp -v utmp /var/log/lastlog</span><br><span class="line">chmod -v 664 /var/log/lastlog</span><br><span class="line">chmod -v 600 /var/log/btmp</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>执行，报错</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">Command &#x27;chroot&#x27; is available in &#x27;/usr/sbin/chroot&#x27;</span><br><span class="line">The command could not be located because &#x27;/usr/sbin&#x27; is not included in the PATH environment variable.</span><br><span class="line">This is most likely caused by the lack of administrative privileges associated with your user account.</span><br><span class="line">chroot: command not found</span><br><span class="line"></span><br><span class="line">查看$PATH</span><br><span class="line">echo $PATH</span><br><span class="line">/mnt/lfs/tools/bin:/bin:/usr/bin</span><br><span class="line"></span><br><span class="line">将/usr/sbin加入$PATH</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">(lfs chroot) root:/sources/gcc-11.2.0/build# ../libstdc++-v3/configure \</span><br><span class="line"> CXXFLAGS=&quot;-g -O2 -D_GNU_SOURCE&quot; \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --host=$(uname -m)-lfs-linux-gnu \</span><br><span class="line"> --disable-libstdcxx-pch</span><br><span class="line">checking build system type... x86_64-pc-linux-gnu</span><br><span class="line">checking host system type... x86_64-lfs-linux-gnu</span><br><span class="line">checking target system type... x86_64-lfs-linux-gnu</span><br><span class="line">checking for a BSD-compatible install... /usr/bin/install -c</span><br><span class="line">checking whether build environment is sane... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-strip... no</span><br><span class="line">checking for strip... strip</span><br><span class="line">checking for a thread-safe mkdir -p... /usr/bin/mkdir -p</span><br><span class="line">checking for gawk... gawk</span><br><span class="line">checking whether make sets $(MAKE)... yes</span><br><span class="line">checking whether make supports nested variables... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-gcc... no</span><br><span class="line">checking for gcc... no</span><br><span class="line">checking for x86_64-lfs-linux-gnu-cc... no</span><br><span class="line">checking for cc... no</span><br><span class="line">checking for x86_64-lfs-linux-gnu-cl.exe... no</span><br><span class="line">checking for cl.exe... no</span><br><span class="line">configure: error: in `/sources/gcc-11.2.0/build&#x27;:</span><br><span class="line">configure: error: no acceptable C compiler found in $PATH</span><br><span class="line">See `config.log&#x27; for more details</span><br><span class="line"></span><br><span class="line">解决：将/tools/bin加入PATH</span><br></pre></td></tr></table></div></figure>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">(lfs chroot) root:/sources/gcc-11.2.0/build# ../libstdc++-v3/configure \</span><br><span class="line"> CXXFLAGS=&quot;-g -O2 -D_GNU_SOURCE&quot; \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --host=$(uname -m)-lfs-linux-gnu \</span><br><span class="line"> --disable-libstdcxx-pch</span><br><span class="line">checking build system type... x86_64-pc-linux-gnu</span><br><span class="line">checking host system type... x86_64-lfs-linux-gnu</span><br><span class="line">checking target system type... x86_64-lfs-linux-gnu</span><br><span class="line">checking for a BSD-compatible install... /usr/bin/install -c</span><br><span class="line">checking whether build environment is sane... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-strip... x86_64-lfs-linux-gnu-strip</span><br><span class="line">checking for a thread-safe mkdir -p... /usr/bin/mkdir -p</span><br><span class="line">checking for gawk... gawk</span><br><span class="line">checking whether make sets $(MAKE)... yes</span><br><span class="line">checking whether make supports nested variables... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-gcc... x86_64-lfs-linux-gnu-gcc</span><br><span class="line">checking for suffix of object files... o</span><br><span class="line">checking whether we are using the GNU C compiler... yes</span><br><span class="line">checking whether x86_64-lfs-linux-gnu-gcc accepts -g... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-gcc option to accept ISO C89... unsupported</span><br><span class="line">checking whether x86_64-lfs-linux-gnu-gcc understands -c and -o together... yes</span><br><span class="line">checking for x86_64-lfs-linux-gnu-g++... x86_64-lfs-linux-gnu-g++</span><br><span class="line">checking whether we are using the GNU C++ compiler... yes</span><br><span class="line">checking whether x86_64-lfs-linux-gnu-g++ accepts -g... yes</span><br><span class="line">checking for special C compiler options needed for large files... no</span><br><span class="line">checking for _FILE_OFFSET_BITS value needed for large files... unknown</span><br><span class="line">checking for _LARGE_FILES value needed for large files... unknown</span><br><span class="line">checking how to run the C preprocessor... /lib/cpp</span><br><span class="line">configure: error: in `/sources/gcc-11.2.0/build&#x27;:</span><br><span class="line">configure: error: C preprocessor &quot;/lib/cpp&quot; fails sanity check</span><br><span class="line">See `config.log&#x27; for more details</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="重启后恢复工作状态-2"   >
          <a href="#重启后恢复工作状态-2" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#重启后恢复工作状态-2"></a> 重启后恢复工作状态 #2</h3>
      
<p>这个时候如果你关机或重新启动，那么重新开机后回到工作状态的步骤是：</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">su</span><br></pre></td></tr></table></div></figure>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">mount -v --bind /dev $LFS/dev</span><br><span class="line"></span><br><span class="line">mount -v --bind /dev/pts $LFS/dev/pts</span><br><span class="line">mount -vt proc proc $LFS/proc</span><br><span class="line">mount -vt sysfs sysfs $LFS/sys</span><br><span class="line">mount -vt tmpfs tmpfs $LFS/run</span><br><span class="line"> </span><br><span class="line">chroot &quot;$LFS&quot; /usr/bin/env -i \</span><br><span class="line"> HOME=/root \</span><br><span class="line"> TERM=&quot;$TERM&quot; \</span><br><span class="line"> PS1=&#x27;(lfs chroot) \u:\w\$ &#x27; \</span><br><span class="line"> PATH=/usr/bin:/usr/sbin \</span><br><span class="line"> /bin/bash --login +h </span><br></pre></td></tr></table></div></figure>

        <h3 id="libstdc-form-gcc-1120-pass-2"   >
          <a href="#libstdc-form-gcc-1120-pass-2" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#libstdc-form-gcc-1120-pass-2"></a> Libstdc++ form GCC-11.2.0 pass 2</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf gcc-11.2.0.tar.xz</span><br><span class="line">cd gcc-11.2.0</span><br><span class="line"></span><br><span class="line">ln -s gthr-posix.h libgcc/gthr-default.h</span><br><span class="line"></span><br><span class="line">mkdir -v build</span><br><span class="line">cd build</span><br><span class="line"></span><br><span class="line">time &#123; ../libstdc++-v3/configure \</span><br><span class="line"> CXXFLAGS=&quot;-g -O2 -D_GNU_SOURCE&quot; \</span><br><span class="line"> --prefix=/usr \</span><br><span class="line"> --disable-multilib \</span><br><span class="line"> --disable-nls \</span><br><span class="line"> --host=$(uname -m)-lfs-linux-gnu \</span><br><span class="line"> --disable-libstdcxx-pch &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"> </span><br><span class="line">cd ../..</span><br><span class="line">rm -rf gcc-11.2.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="gettext-021"   >
          <a href="#gettext-021" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#gettext-021"></a> Gettext-0.21</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf gettext-0.21.tar.xz</span><br><span class="line">cd gettext-0.21</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --disable-shared &amp;&amp; make;&#125;</span><br><span class="line"></span><br><span class="line">cp -v gettext-tools/src/&#123;msgfmt,msgmerge,xgettext&#125; /usr/bin</span><br><span class="line"></span><br><span class="line">cd ..rm -rf gettext-0.21</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="bison-376"   >
          <a href="#bison-376" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#bison-376"></a> Bison-3.7.6</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf bison-3.7.6.tar.xz</span><br><span class="line">cd bison-3.7.6</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --docdir=/usr/share/doc/bison-3.7.6 &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf bison-3.7.6</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="perl-5340"   >
          <a href="#perl-5340" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#perl-5340"></a> Perl-5.34.0</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf perl-5.34.0.tar.xz</span><br><span class="line">cd perl-5.34.0</span><br><span class="line"></span><br><span class="line">time &#123; sh Configure -des \</span><br><span class="line"> -Dprefix=/usr \</span><br><span class="line"> -Dvendorprefix=/usr \</span><br><span class="line"> -Dprivlib=/usr/lib/perl5/5.34/core_perl \</span><br><span class="line"> -Darchlib=/usr/lib/perl5/5.34/core_perl \</span><br><span class="line"> -Dsitelib=/usr/lib/perl5/5.34/site_perl \</span><br><span class="line"> -Dsitearch=/usr/lib/perl5/5.34/site_perl \</span><br><span class="line"> -Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \</span><br><span class="line"> -Dvendorarch=/usr/lib/perl5/5.34/vendor_perl &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf perl-5.34.0</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>编译安装失败，运行make test，发现以下报错：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br></pre></td><td class="code"><pre><span class="line">sh Configure -des \</span><br><span class="line"> -Dprefix=/usr \</span><br><span class="line"> -Dvendorprefix=/usr \</span><br><span class="line"> -Dprivlib=/usr/lib/perl5/5.34/core_perl \</span><br><span class="line"> -Darchlib=/usr/lib/perl5/5.34/core_perl \</span><br><span class="line"> -Dsitelib=/usr/lib/perl5/5.34/site_perl \</span><br><span class="line"> -Dsitearch=/usr/lib/perl5/5.34/site_perl \</span><br><span class="line"> -Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \</span><br><span class="line"> -Dvendorarch=/usr/lib/perl5/5.34/vendor_perl</span><br><span class="line"> </span><br><span class="line"> make</span><br><span class="line"> make install</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Failed 6 tests out of 2437, 99.75% okay.</span><br><span class="line">	../cpan/Socket/t/getnameinfo.t</span><br><span class="line">	../dist/Net-Ping/t/110_icmp_inst.t</span><br><span class="line">	../dist/Net-Ping/t/500_ping_icmp.t</span><br><span class="line">	../dist/Net-Ping/t/501_ping_icmpv6.t</span><br><span class="line">	../dist/Net-Ping/t/520_icmp_ttl.t</span><br><span class="line">	../lib/Net/hostent.t</span><br><span class="line"></span><br><span class="line">cpan/Socket/t/getnameinfo ........................................ #   Failed test &#x27;$err == 0 for &#123;family=AF_INET,port=80,sinaddr=127.0.0.1&#125;/NI_NUMERICSERV&#x27;</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">  at t/getnameinfo.t line 26.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">         got: -3</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    expected: 0</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">  Failed <span class="built_in">test</span> <span class="string">&#x27;$host is nonzero length for NS&#x27;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">  at t/getnameinfo.t line 30.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Looks like you failed 2 tests of 13.</span></span><br><span class="line">FAILED at test 9</span><br><span class="line"></span><br><span class="line">dist/Net-Ping/t/520_icmp_ttl ..................................... Can&#x27;t get icmp protocol by name at t/520_icmp_ttl.t line 23.</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Looks like your <span class="built_in">test</span> exited with 2 just after 1.</span></span><br><span class="line">FAILED--non-zero wait status: 512</span><br><span class="line"></span><br><span class="line">dist/Net-Ping/t/501_ping_icmpv6 .................................. Can&#x27;t get ipv6-icmp protocol by name at t/501_ping_icmpv6.t line 49.</span><br><span class="line">FAILED--no leader found</span><br><span class="line"></span><br><span class="line">dist/Net-Ping/t/500_ping_icmp .................................... Can&#x27;t get icmp protocol by name at t/500_ping_icmp.t line 58.</span><br><span class="line">FAILED--no leader found</span><br><span class="line"></span><br><span class="line">dist/Net-Ping/t/110_icmp_inst .................................... Can&#x27;t get icmp protocol by name at t/110_icmp_inst.t line 24.</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Looks like your <span class="built_in">test</span> exited with 2 just after 1.</span></span><br><span class="line">FAILED--expected 2 tests, saw 1</span><br><span class="line"></span><br><span class="line">lib/Net/hostent .................................................. #   Failed test &#x27;gethostbyaddr(&#x27;127.0.0.1&#x27;)&#x27;</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">  at ../lib/Net/hostent.t line 46.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Looks like your <span class="built_in">test</span> exited with 1 just after 4.</span></span><br><span class="line">FAILED at test 4</span><br><span class="line"></span><br><span class="line">以及一个ok的提示</span><br><span class="line">t/op/magic ....................................................... Can&#x27;t exec &quot;ps&quot;: No such file or directory at op/magic.t line 830.</span><br><span class="line">ok</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## Since not all tests were successful, you may want to run some of</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## them individually and examine any diagnostic messages they produce.</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## See the INSTALL document&#x27;s section on &quot;make test&quot;.</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## You have a good chance to get more information by running</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##   ./perl harness</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## in the &#x27;t&#x27; directory since most (&gt;=80%) of the tests succeeded.</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## You may have to set your dynamic library search path,</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## LD_LIBRARY_PATH, to point to the build directory:</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##   setenv LD_LIBRARY_PATH `pwd`; cd t; ./perl harness</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##   LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH; cd t; ./perl harness</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##   export LD_LIBRARY_PATH=`pwd`; cd t; ./perl harness</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## for csh-style shells, like tcsh; or for traditional/modern</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">## Bourne-style shells, like bash, ksh, and zsh, respectively.</span></span></span><br><span class="line">Elapsed: 643 sec</span><br><span class="line">u=8.43  s=26.63  cu=281.27  cs=143.48  scripts=2437  tests=1120821</span><br><span class="line"></span><br><span class="line">解决：</span><br><span class="line">从root切换回lfs，再度编译</span><br></pre></td></tr></table></div></figure>

        <h3 id="python-396"   >
          <a href="#python-396" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#python-396"></a> Python-3.9.6</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf Python-3.9.6.tar.xz</span><br><span class="line">cd Python-3.9.6</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr \</span><br><span class="line"> --enable-shared \</span><br><span class="line"> --without-ensurepip &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf Python-3.9.6</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="texinfo-68"   >
          <a href="#texinfo-68" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#texinfo-68"></a> Texinfo-6.8</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf texinfo-6.8.tar.xz</span><br><span class="line">cd texinfo-6.8</span><br><span class="line"></span><br><span class="line">sed -e &#x27;s/__attribute_nonnull__/__nonnull/&#x27; \</span><br><span class="line"> -i gnulib/lib/malloc/dynarray-skeleton.c</span><br><span class="line"></span><br><span class="line">time &#123; ./configure --prefix=/usr &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf texinfo-6.8</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="util-linux-2372"   >
          <a href="#util-linux-2372" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#util-linux-2372"></a> Util-linux-2.37.2</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">tar -xvf util-linux-2.37.2.tar.xz</span><br><span class="line">cd util-linux-2.37.2</span><br><span class="line"></span><br><span class="line">mkdir -pv /var/lib/hwclock</span><br><span class="line"></span><br><span class="line">time &#123; ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \</span><br><span class="line"> --libdir=/usr/lib \</span><br><span class="line"> --docdir=/usr/share/doc/util-linux-2.37.2 \</span><br><span class="line"> --disable-chfn-chsh \</span><br><span class="line"> --disable-login \</span><br><span class="line"> --disable-nologin \</span><br><span class="line"> --disable-su \</span><br><span class="line"> --disable-setpriv \</span><br><span class="line"> --disable-runuser \</span><br><span class="line"> --disable-pylibmount \</span><br><span class="line"> --disable-static \</span><br><span class="line"> --without-python \</span><br><span class="line"> runstatedir=/run &amp;&amp; make &amp;&amp; make install;&#125;</span><br><span class="line"></span><br><span class="line">cd ..</span><br><span class="line">rm -rf util-linux-2.37.2</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h3 id="清理和备份临时系统"   >
          <a href="#清理和备份临时系统" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#清理和备份临时系统"></a> 清理和备份临时系统</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">rm -rf /usr/share/&#123;info,man,doc&#125;/*</span><br><span class="line"></span><br><span class="line">find /usr/&#123;lib,libexec&#125; -name \*.la -delete</span><br><span class="line"></span><br><span class="line">rm -rf /tools</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>用快照备份系统，不建议用书中方式。</p>
</div><footer class="post-footer"><div class="post-ending ending"><div class="ending__text">------ 本文结束，感谢您的阅读 ------</div></div><div class="post-copyright copyright"><div class="copyright-author"><span class="copyright-author__name">本文作者: </span><span class="copyright-author__value"><a href="http://hipposox.github.io">HippoSoX</a></span></div><div class="copyright-link"><span class="copyright-link__name">本文链接: </span><span class="copyright-link__value"><a href="http://hipposox.github.io/2023/01/12/LFS-III-%E6%9E%84%E5%BB%BALFS%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7/">http://hipposox.github.io/2023/01/12/LFS-III-%E6%9E%84%E5%BB%BALFS%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7/</a></span></div><div class="copyright-notice"><span class="copyright-notice__name">版权声明: </span><span class="copyright-notice__value">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" rel="external nofollow" target="_blank">BY-NC-SA</a> 许可协议。转载请注明出处！</span></div></div><div class="post-tags"><span class="post-tags-item"><span class="post-tags-item__icon"><i class="fas fa-tag"></i></span><a class="post-tags-item__link" href="http://hipposox.github.io/tags/LFS/">LFS</a></span></div><nav class="post-paginator paginator"><div class="paginator-prev"><a class="paginator-prev__link" href="/2023/01/12/LFS-IV%E6%9E%84%E5%BB%BALFS%E7%B3%BB%E7%BB%9F/"><span class="paginator-prev__icon"><i class="fas fa-angle-left"></i></span><span class="paginator-prev__text">LFS-IV-构建LFS系统</span></a></div><div class="paginator-next"><a class="paginator-next__link" href="/2023/01/12/LFS-II-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/"><span class="paginator-prev__text">LFS-II-准备工作</span><span class="paginator-next__icon"><i class="fas fa-angle-right"></i></span></a></div></nav></footer></div></div></div><div class="sidebar-wrap" id="sidebar-wrap"><aside class="sidebar" id="sidebar"><div class="sidebar-nav"><span class="sidebar-nav-toc current">文章目录</span><span class="sidebar-nav-ov">站点概览</span></div><section class="sidebar-toc"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#iii-%E6%9E%84%E5%BB%BA-lfs-%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7"><span class="toc-number">1.</span> <span class="toc-text">
           III 构建 LFS 交叉工具链和临时工具</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC5%E8%8A%82-%E7%BC%96%E8%AF%91%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91%E5%B7%A5%E5%85%B7%E9%93%BE"><span class="toc-number">1.1.</span> <span class="toc-text">
           第5节 编译交叉编译工具链</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#binutils-237-pass-1"><span class="toc-number">1.1.1.</span> <span class="toc-text">
           Binutils-2.37 - Pass 1</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#gcc-1120-pass-1"><span class="toc-number">1.1.2.</span> <span class="toc-text">
           GCC-11.2.0 - Pass 1</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#linux-51312-api-headers"><span class="toc-number">1.1.3.</span> <span class="toc-text">
           Linux-5.13.12 API Headers</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#glibc-234"><span class="toc-number">1.1.4.</span> <span class="toc-text">
           glibc-2.34</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#libstdc-from-gcc-1120-pass-1"><span class="toc-number">1.1.5.</span> <span class="toc-text">
           Libstdc++ from GCC-11.2.0 - Pass 1</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E5%90%AF%E5%90%8E%E5%9B%9E%E5%A4%8D%E5%B7%A5%E4%BD%9C%E7%8A%B6%E6%80%81-1"><span class="toc-number">1.1.6.</span> <span class="toc-text">
           重启后回复工作状态 #1</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC6%E7%AB%A0-%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7"><span class="toc-number">1.2.</span> <span class="toc-text">
           第6章 交叉编译临时工具</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#m4-1419"><span class="toc-number">1.2.1.</span> <span class="toc-text">
           m4-1.4.19</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%87%BA%E9%94%99%E8%A7%A3%E5%86%B3"><span class="toc-number">1.2.2.</span> <span class="toc-text">
           出错解决</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#m4coreutilsgzipsedtar"><span class="toc-number">1.2.2.1.</span> <span class="toc-text">
           m4&amp;coreutils&amp;Gzip&amp;sed&amp;tar:</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#diffutilsgreppatch"><span class="toc-number">1.2.2.2.</span> <span class="toc-text">
           diffutils&amp;grep&amp;patch:</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#findutils"><span class="toc-number">1.2.2.3.</span> <span class="toc-text">
           findutils:</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#ncurses-62"><span class="toc-number">1.2.3.</span> <span class="toc-text">
           Ncurses-6.2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#bash-518"><span class="toc-number">1.2.4.</span> <span class="toc-text">
           Bash-5.1.8</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#coreutils-832"><span class="toc-number">1.2.5.</span> <span class="toc-text">
           coreutils-8.32</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#diffutils-38"><span class="toc-number">1.2.6.</span> <span class="toc-text">
           diffutils-3.8</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#file-540"><span class="toc-number">1.2.7.</span> <span class="toc-text">
           File-5.40</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#findutils-480"><span class="toc-number">1.2.8.</span> <span class="toc-text">
           Findutils-4.8.0</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#gawk-510"><span class="toc-number">1.2.9.</span> <span class="toc-text">
           gawk-5.1.0</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#grep-37"><span class="toc-number">1.2.10.</span> <span class="toc-text">
           grep-3.7</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#gzip-110"><span class="toc-number">1.2.11.</span> <span class="toc-text">
           gzip-1.10</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#make-43"><span class="toc-number">1.2.12.</span> <span class="toc-text">
           Make-4.3</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#patch-276"><span class="toc-number">1.2.13.</span> <span class="toc-text">
           Patch-2.7.6</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#sed-48"><span class="toc-number">1.2.14.</span> <span class="toc-text">
           Sed-4.8</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#tar-134"><span class="toc-number">1.2.15.</span> <span class="toc-text">
           tar-1.34</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#xz-525"><span class="toc-number">1.2.16.</span> <span class="toc-text">
           xz-5.2.5</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#binutils-237-pass-2"><span class="toc-number">1.2.17.</span> <span class="toc-text">
           binutils-2.37 pass 2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#gcc-1120-pass-2"><span class="toc-number">1.2.18.</span> <span class="toc-text">
           GCC-11.2.0 pass 2</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC7%E7%AB%A0-%E6%94%B9%E5%8F%98%E6%96%87%E4%BB%B6%E5%B1%9E%E4%B8%BB%E5%B9%B6%E6%9E%84%E5%BB%BA%E5%85%B6%E4%BB%96%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7"><span class="toc-number">1.3.</span> <span class="toc-text">
           第7章 改变文件属主并构建其他临时工具</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#chroot"><span class="toc-number">1.3.1.</span> <span class="toc-text">
           chroot</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E5%90%AF%E5%90%8E%E6%81%A2%E5%A4%8D%E5%B7%A5%E4%BD%9C%E7%8A%B6%E6%80%81-2"><span class="toc-number">1.3.2.</span> <span class="toc-text">
           重启后恢复工作状态 #2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#libstdc-form-gcc-1120-pass-2"><span class="toc-number">1.3.3.</span> <span class="toc-text">
           Libstdc++ form GCC-11.2.0 pass 2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#gettext-021"><span class="toc-number">1.3.4.</span> <span class="toc-text">
           Gettext-0.21</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#bison-376"><span class="toc-number">1.3.5.</span> <span class="toc-text">
           Bison-3.7.6</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#perl-5340"><span class="toc-number">1.3.6.</span> <span class="toc-text">
           Perl-5.34.0</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#python-396"><span class="toc-number">1.3.7.</span> <span class="toc-text">
           Python-3.9.6</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#texinfo-68"><span class="toc-number">1.3.8.</span> <span class="toc-text">
           Texinfo-6.8</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#util-linux-2372"><span class="toc-number">1.3.9.</span> <span class="toc-text">
           Util-linux-2.37.2</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B8%85%E7%90%86%E5%92%8C%E5%A4%87%E4%BB%BD%E4%B8%B4%E6%97%B6%E7%B3%BB%E7%BB%9F"><span class="toc-number">1.3.10.</span> <span class="toc-text">
           清理和备份临时系统</span></a></li></ol></li></ol></li></ol></section><!-- ov = overview--><section class="sidebar-ov hide"><div class="sidebar-ov-author"><div class="sidebar-ov-author__avatar"><img class="sidebar-ov-author__avatar_img" src="/images/icons/stun-logo.svg" alt="avatar"></div><p class="sidebar-ov-author__text">motto</p></div><div class="sidebar-ov-state"><a class="sidebar-ov-state-item sidebar-ov-state-item--posts" href="/archives/"><div class="sidebar-ov-state-item__count">19</div><div class="sidebar-ov-state-item__name">归档</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--categories" href="/categories/"><div class="sidebar-ov-state-item__count">6</div><div class="sidebar-ov-state-item__name">分类</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--tags" href="/tags/"><div class="sidebar-ov-state-item__count">14</div><div class="sidebar-ov-state-item__name">标签</div></a></div><div class="sidebar-ov-cc"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" data-popover="知识共享许可协议" data-popover-pos="up"><img src="/images/cc-by-nc-sa.svg"></a></div></section><div class="sidebar-reading"><div class="sidebar-reading-info"><span class="sidebar-reading-info__text">你已阅读了 </span><span class="sidebar-reading-info__num">0</span><span class="sidebar-reading-info__perc">%</span></div><div class="sidebar-reading-line"></div></div><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1449790718&auto=1&height=66"></iframe></aside></div><div class="clearfix"></div></div></main><footer class="footer" id="footer"><div class="footer-inner"><div><span>Copyright © 2023</span><span class="footer__icon"><i class="fas fa-heart"></i></span><span>HippoSoX</span></div><div><span>由 <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a> 强力驱动</span><span> v5.4.2</span><span class="footer__devider">|</span><span>主题 - <a href="https://github.com/liuyib/hexo-theme-stun/" title="Stun" target="_blank" rel="noopener">Stun</a></span><span> v2.8.0</span></div></div></footer><div class="loading-bar" id="loading-bar"><div class="loading-bar__progress"></div></div><div class="back2top" id="back2top"><span class="back2top__icon"><i class="fas fa-rocket"></i></span></div></div><script src="https://cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js"></script><script src="https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js"></script><script src="/js/utils.js?v=2.8.0"></script><script src="/js/stun-boot.js?v=2.8.0"></script><script src="/js/scroll.js?v=2.8.0"></script><script src="/js/header.js?v=2.8.0"></script><script src="/js/sidebar.js?v=2.8.0"></script></body></html>